<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>props的对象语法</h2>
      <child name="pengshao" :age="30" :show="true"></child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child = {
        // props: ["name", "age"],
        props: {
          name: String,
          age: Number,
          show: Boolean,
        },
        template: `
          <div>child组件 - {{ name }} - {{ age }}</div>
        `,
      };
      new Vue({
        el: "#app",
        data: {
          // age: 30,
        },
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
